var area = {
    '0': '全国通用',
    '8': '北京',
    '9': '上海',
    '10': '广东',
    '11': '浙江',
    '12': '四川',
    '13': '重庆',
    '14': '江苏',
    '15': '山东',
    '16': '山西',
    '17': '河北',
    '18': '安徽',
    '19': '宁夏',
    '20': '陕西',
}

var docWid;
var contWid;
var local;
var timeCount;

var chapterName;

function queryString(key) {
    var result = window.location.href.match(new RegExp("[\?\&]" + key + "=([^\&]*)(\&?)", "i"));
    return result ? result[1] : result;
}

function loadQues(qCurrent, qNumber, qCount) {
    $('#pracCurrent').html('第' + qCurrent + '题');
    $('#pracCont').html(question[qNumber][3] + '. ' + question[qNumber][0]);
    if (question[qNumber][2] == 1) {
        $('#pracAns1').show();
        $('#pracAns2').hide();
    } else {
        $('#pracAns1').hide();
        $('#pracAns2').show();
    }
    
    $('#pracAns1 input[type="radio"]:checked, #pracAns2 input[type="radio"]:checked').removeAttr('checked');
    var answer=localStorage['q'+qNumber]
    if(answer){
        $('#pracAns'+question[qNumber][2]).find('input[type="radio"][value="'+answer+'"]').attr('checked','checked');
    }
    
    
    if (qCurrent == 1) {
        $('#prev').button('disable');
    } else {
        $('#prev').button('enable');
    }
    if (qCurrent == qCount) {
        $('#next').button('disable');
    } else {
        $('#next').button('enable');
    }
}